package com.iims.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iims.project.domain.CmisWorkToken;
import com.iims.project.vo.query.GroupWorkTokenSearchQuery;
import com.iims.project.vo.resp.CmisWorkTokenRowVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author fanpei
 * @date 2021/7/7 13:23
 */
public interface CmisWorkTokenMapper extends BaseMapper<CmisWorkToken> {

    /**
     * 条件筛选工作令
     *
     * @param project
     * @return
     */
    List<CmisWorkTokenRowVo> selectWorkTokenList(CmisWorkToken project);

    /**
     * 分组搜索工作令
     *
     * @param groupSearchQuery
     * @return
     */
    List<CmisWorkTokenRowVo> selectWorkTokenListByGroup(GroupWorkTokenSearchQuery groupSearchQuery);


    /**
     * 查询项目详情
     *
     * @return
     */
    CmisWorkTokenRowVo selectWorkTokenDetail(@Param("workTokenId") Long workTokenId);

    /**
     * 查询项目使用个数【查询待完善，完成部分】
     *
     * @param workTokenId
     * @return
     */
    int selectWorkTokenUseCount(@Param("workTokenId") Long workTokenId);

    /**
     * 获取项目所属工作令列表
     *
     * @param proId
     * @return
     */
    List<CmisWorkTokenRowVo> selectProWorkTokenList(@Param("proId") Long proId);

    /**
     * 获取合同所属工作令列表
     *
     * @param contractId
     * @return
     */
    List<CmisWorkTokenRowVo> selectContractWorkTokenList(@Param("contractId") Long contractId);
}
